package com.wujilee.dbredissyn.controller;

import com.wujilee.dbredissyn.entity.EntityUser;
import com.wujilee.dbredissyn.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author liwuji
 * @date 2024/5/14
 * @desc
 **/
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService; 
    @PostMapping
    public Boolean save(EntityUser entityUser){
        return userService.save(entityUser);
    }
    @PostMapping("/delete")
    public Boolean delete(EntityUser entityUser){
        return userService.delete(entityUser);
    }

    @GetMapping("/{id}")
    public EntityUser getUser(@PathVariable("id")String id ){
        return userService.getUser(id);
    }
}
